﻿@{
    Layout = null;
    ViewBag.Title = "Index";
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Back Center</title>
    @Html.Partial("_HeadScriptBlock")
    <script type="text/javascript">
        $(function () {
            $(".loginadmin").click(function () {
                
                var username = $.trim($("[name='username']").val());
                var password = $.trim($("[name='password']").val());
                var safecode = $.trim($("[name='safecode']").val());
                if (username == "") {
                    mAlertManager.error("请填写用户名",2000);
                    $("[name='username']").focus();
                    return;
                }
                if (password == "") {
                    mAlertManager.error("请填写密码", 2000);
                    $("[name='password']").focus();
                    return;
                }
                if (safecode == "") {
                    mAlertManager.error("请填写验证码", 2000);
                    $("[name='safecode']").focus();
                    return;
                }
                var data = { username: username, password: password, safecode: safecode };
                var option = {
                    url: "@Url.Action("Auth")",
                    data: data,
                    type: "POST",
                    dataType: "json",
                    success: function (json) {
                        if (!json.success) {
                            mAlertManager.error(json.message);
                            $("#codeimg").click();
                            $("[name='safecode']").val("");
                            return;
                        } else {
                            location.href = "/Home";
                        }
                    }
                };
                $.ajax(option);
            });


            $(".inputTxt a").click(function () {
                $(this).prev().find("input").val("");
            });

            $("[name='reset']").click(function () {
                $("[name='username']").val("");
                $("[name='password']").val("");
                $("[name='safecode']").val("");
            });
            $("#codeimg").click(function () {
                var src = "/Security/SafeCode";
                $(this).attr("src", src + "?rnd=" + new Date().getTime());
            });

            $(".refreshsafecode").click(function () {
                $("#codeimg").click();
            });

            document.onkeydown = function (e) {
                var ev = document.all ? window.event : e;
                if (ev.keyCode == 13) {
                    $(".loginadmin").click();
                }
            }

        });
    </script>
<!--[if lte IE 6]>
<script>
function correctPNG()
   {
   for(var i=0; i<document.images.length; i++)
      {
   var img = document.images[i]
   var imgName = img.src.toUpperCase()
   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
   var imgID = (img.id) ? "id='" + img.id + "' " : ""
   var imgClass = (img.className) ? "class='" + img.className + "' " : ""
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
   var imgStyle = "display:inline-block;" + img.style.cssText
   if (img.align == "left") imgStyle = "float:left;" + imgStyle
   if (img.align == "right") imgStyle = "float:right;" + imgStyle
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
      + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
   img.outerHTML = strNewHTML
   i = i-1
      }
      }
   }
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->
<style type="text/css">
body,p,input{padding:0;margin:0;}
img{border:none;}
body{font-size:12px;line-height:22px; background:url(/Resources/login/bg.gif);}
.pbg{ position:relative; z-index:0;}
.main{position:absolute; top:30%; left:39%; z-index:10; height:0; line-height:0; width:364px; margin:0 auto;}
.logo{ position:absolute; top:32px; left:142px; z-index:1000;}
.tit{ position:absolute; top:0; left:0;}
.lobg{ position:absolute; top:60px;}
.login{ position:absolute;  top:88px; left:28px; width:305px; }
.login td{padding-bottom:9px;}
.inputTxt{ position:relative; width:172px; height:33px;}
.inputTxt span{ position:absolute; top:0; left:0; z-index:0;}
.inputTxt input{position:absolute; top:2px; left:6px; z-index:10;background:url(/Resources/login/trans.gif); border:none; widows:150px; height:28px; line-height:28px; color:#FFF;}
.yzm{width:103px;height:29px;position:relative; float:left; margin-right:12px;}
.yzm span{ position:absolute; top:0; left:0; z-index:0;} 
.yzm input{background:url(/Resources/login/trans.gif); position:absolute; top:2px; left:5px; width:93px; z-index:10; border:none; height:24px; line-height:24px; color:#FFF;}
.ft{ position:absolute; z-index:1000; bottom:20px; left:40%; }
.inputTxt a{ display:block;background:url(/Resources/login/trans.gif); position:absolute; top:6px; right:6px; width:16px; height:16px; z-index:10; }
.pcio{position:absolute; top:30%; left:39%; z-index:5; margin-left:-200px; }
.sig{ position:absolute; bottom:10%; right:2%; width:150px; height:68px; opacity:0.6}
.sig img{ width:100%;height:100%}
</style>
</head>

<body>

<div class="logo"><a href="#"><img src="/Resources/login/logo.png" /></a></div>
<div class="ft"><img src="/Resources/login/ft.png" /></div>
<div class="main">
    <span class="lobg"><img src="/Resources/login/lobg.png" /></span>
    <div class="login">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="39" height="33"><img src="/Resources/login/ico1.png" /></td>
            <td width="172">
                <div class="inputTxt">
                    <span><img src="/Resources/login/inbg2.png" /></span>
                    <p><input name="username" type="text" tabindex="1" /></p>
                    <a href="javascript://" tabindex="-1"></a>
                </div>
            </td>
            <td rowspan="2" align="right"><a href="javascript://" class="loginadmin" tabindex="4"><img src="/Resources/login/login.png" /></a></td>
          </tr>
          <tr>
            <td><img src="/Resources/login/ico2.png" /></td>
            <td>
                <div class="inputTxt">
                    <span><img src="/Resources/login/inbg.png" /></span>
                    <p><input name="password" type="password" tabindex="2" /></p>
                    <a href="javascript://" tabindex="-1"></a>
                </div>
            </td>
          </tr>
          <tr>
            <td colspan="2">
               <div class="yzm">
                    <span><img src="/Resources/login/yzm.png" /></span>
                    <p><input name="safecode" type="text" maxlength="4" tabindex="3" /></p>
               </div>
               <div><img id="codeimg" src="/Security/SafeCode" style=" vertical-align:middle" /></div>
            </td>
            <td><a href="javascript://" class="refreshsafecode" style=" color:#fff;">看不请，换一下</a>&nbsp;</td>
          </tr>
        </table>
    </div>
    <div class="tit"><img src="/Resources/login/tit.png" /></div>
</div>
<div class="pcio"><img src="/Resources/login/pico.png" /></div>
<div class="pbg"><img src="/Resources/login/pbg.jpg" width="100%" /></div>
<div class="sig"><img src="/Resources/login/sig.png" /></div>

</body>
</html>
